#css-loader webpack
Explore tagged Tumblr posts
Text
89/100 Days of Code
It's a small bit of progression, but I am counting it because it happened! I spent only 15 or 20 minutes programming tonight, but I completed more of the Webpack tutorial articles that I've already done before, to assign a Class to a Paragraph using CSS Loaders and Style Loaders in Webpack.
I love Webpack! It just takes me so long to do. Things will get easier with time.
Thanks for sticking with me. We're almost to 100 Days, can you believe how far we have come! 😀
0 notes
Text
Подключение СSS файлов
Устанавливаю плагин- команда npm install style-loader --save
следующий плагин css loader устанавливаю из корневой папки проекта:
npm install css-loader --save
Эти два плагина необходимо установить, чтобы webpack мог загрузить и распарсить css файлы.
Затем добавить плагин к нашему вебпаку таким образом:
import css from 'file.css';
После этого внесем изменения в файл webpack.config.js.
После изменений он выглядит так:
Перезапустить сервер команда npm start. И стили будут подключены
Вот так:
0 notes
Text
CSS MINIFIER THE BEST TOOLS
CSS MINIFIER The Best Tools
css minifier api command line npm webpack php node to normal offline minify and compress compressor js wordpress plugin online javascript bootstrap babel best beautifier browser brackets comparison check closure code download de decompressor decompress dreamweaver
directory drupal expand minified error explained express email example eclipse file for from format github gulp generator grunt html htaccess helps with multiple option how inverse @import in visual studio phpstorm java codeigniter keep comments library by laravel mix linux liquid media query map
mac means magento 2 modules maven method notepad++ normalize tool on options python postcss performance reverse remove rollup reset regex rails readable stack overflow sass shopify sublime text 3 style size single unminify uglify un using upload ubuntu url vscode 2017 & version 4 windows without
yii2 files package minify-css-string 5 script php-html-css-js-minifier.php topic nodejs convert change converter vs minify_css_compressor netbeans 8.2 apache way c# extension free exclude gradle gulpfile.js css/javascript next string your asp.net cara gtmetrix minifying joomla resources (html javascript)
wp rocket yslow css/bootstrap.min.css bootstrap.min.css not cdn beautify prettify minification unknown kaios django function software spaces tools gzip break whitespace checker yui-compressor ve nedir minimize cc 8 7 cannot read property 'length' of undefined find module 'is-obj' expected a
pseudo-class or pseudo-element postcss-svgo missed semicolon 'type' 'trim' lexical 1 unrecognized the can reduce network payload sizes compare dev/css/minify combine divi w3 total cache task minifies gulp-sass concat all rename gulp-clean-css clean gulp-minify-css working names special scss watch
css-html-js-minify nginx which attribute brainly benefits bash button css.com class cli document difference google loader one meaning minify_css middleman build server react terminal tutorial 2019 2015 create (minify) zend framework opencart symfony
#html#css#cssminifier#coding#htmlparse#ruby#vscode#flex css#css display grid#css grid layout#column grid#tag css#grid css#html & css
3 notes
·
View notes
Text
A Font-Like SVG Icon System for Vue
Managing a custom collection of icons in a Vue app can be challenging at times. An icon font is easy to use, but for customization, you have to rely on third-party font generators, and merge conflicts can be painful to resolve since fonts are binary files.
Using SVG files instead can eliminate those pain points, but how can we ensure they’re just as easy to use while also making it easy to add or remove icons?
Here is what my ideal icon system looks like:
To add icons, you just drop them into a designated icons folder. If you no longer need an icon, you simply delete it.
To use the rocket.svg icon in a template, the syntax is as simple as <svg-icon icon="rocket" />.
The icons can be scaled and colored using the CSS font-size and color properties (just like an icon font).
If multiple instances of the same icon appear on the page, the SVG code is not duplicated each time.
No webpack config editing is required.
This is what we will build by writing two small, single-file components. There are a few specific requirements for this implementation, though I’m sure many of you wizards out there could rework this system for other frameworks and build tools:
webpack: If you used the Vue CLI to scaffold your app, then you’re already using webpack.
svg-inline-loader: This allows us to load all of our SVG code and clean up portions we do not want. Go ahead and run npm install svg-inline-loader --save-dev from the terminal to get started.
The SVG sprite component
To meet our requirement of not repeating SVG code for each instance of an icon on the page, we need to build an SVG “sprite.” If you haven’t heard of an SVG sprite before, think of it as a hidden SVG that houses other SVGs. Anywhere we need to display an icon, we can copy it out of the sprite by referencing the id of the icon inside a <use> tag like this:
<svg><use xlink:href="#rocket" /></svg>
That little bit of code is essentially how our <SvgIcon> component will work, but let’s go ahead create the <SvgSprite> component first. Here is the entire SvgSprite.vue file; some of it may seem daunting at first, but I will break it all down.
<!-- SvgSprite.vue --> <template> <svg width="0" height="0" style="display: none;" v-html="$options.svgSprite" /> </template> <script> const svgContext = require.context( '!svg-inline-loader?' + 'removeTags=true' + // remove title tags, etc. '&removeSVGTagAttrs=true' + // enable removing attributes '&removingTagAttrs=fill' + // remove fill attributes '!@/assets/icons', // search this directory true, // search subdirectories /\w+\.svg$/i // only include SVG files ) const symbols = svgContext.keys().map(path => { // get SVG file content const content = svgContext(path) // extract icon id from filename const id = path.replace(/^\.\/(.*)\.\w+$/, '$1') // replace svg tags with symbol tags and id attribute return content.replace('<svg', `<symbol id="${id}"`).replace('svg>', 'symbol>') }) export default { name: 'SvgSprite', svgSprite: symbols.join('\n'), // concatenate all symbols into $options.svgSprite } </script>
In the template, our lone <svg> element has its content bound to $options.svgSprite. In case you’re unfamiliar with $options it contains properties that are directly attached to our Vue component. We could have attached svgSprite to our component’s data, but we don’t really need Vue to set up reactivity for this since our SVG loader is only going to run when our app builds.
In our script, we use require.context to retrieve all of our SVG files and clean them up while we’re at it. We invoke svg-inline-loader and pass it several parameters using syntax that is very similar to query string parameters. I’ve broken these up into multiple lines to make them easier to understand.
const svgContext = require.context( '!svg-inline-loader?' + 'removeTags=true' + // remove title tags, etc. '&removeSVGTagAttrs=true' + // enable removing attributes '&removingTagAttrs=fill' + // remove fill attributes '!@/assets/icons', // search this directory true, // search subdirectories /\w+\.svg$/i // only include SVG files )
What we’re basically doing here is cleaning up the SVG files that live in a specific directory (/assets/icons) so that they’re in good shape to use anywhere we need them.
The removeTags parameter strips out tags that we do not need for our icons, such as title and style. We especially want to remove title tags since those can cause unwanted tooltips. If you would like to preserve any hard-coded styling in your icons, then add removingTags=title as an additional parameter so that only title tags are removed.
We also tell our loader to remove fill attributes, so that we can set our own fill colors with CSS later. It’s possible you will want to retain your fill colors. If that’s the case, then simply remove the removeSVGTagAttrs and removingTagAttrs parameters.
The last loader parameter is the path to our SVG icon folder. We then provide require.context with two more parameters so that it searches subdirectories and only loads SVG files.
In order to nest all of our SVG elements inside our SVG sprite, we have to convert them from <svg> elements into SVG <symbol> elements. This is as simple as changing the tag and giving each one a unique id, which we extract from the filename.
const symbols = svgContext.keys().map(path => { // extract icon id from filename const id = path.replace(/^\.\/(.*)\.\w+$/, '$1') // get SVG file content const content = svgContext(path) // replace svg tags with symbol tags and id attribute return content.replace('<svg', `<symbol id="${id}"`).replace('svg>', 'symbol>') })
What do we do with this <SvgSprite> component? We place it on our page before any icons that depend on it. I recommend adding it to the top of the App.vue file.
<!-- App.vue --> <template> <div id="app"> <svg-sprite /> <!-- ... -->
The icon component
Now let’s build the SvgIcon.vue component.
<!-- SvgIcon.vue --> <template> <svg class="icon" :class="{ 'icon-spin': spin }"> <use :xlink:href="`#${icon}`" /> </svg> </template> <script> export default { name: 'SvgIcon', props: { icon: { type: String, required: true, }, spin: { type: Boolean, default: false, }, }, } </script> <style> svg.icon { fill: currentColor; height: 1em; margin-bottom: 0.125em; vertical-align: middle; width: 1em; } svg.icon-spin { animation: icon-spin 2s infinite linear; } @keyframes icon-spin { from { transform: rotate(0deg); } to { transform: rotate(359deg); } } </style>
This component is much simpler. As previously mentioned, we leverage the <use> tag to reference an id inside our sprite. That id comes from our component’s icon prop.
I’ve added a spin prop in there that toggles an .icon-spin class as an optional bit of animation, should we ever need. This could, for example, be useful for a loading spinner icon.
<svg-icon v-if="isLoading" icon="spinner" spin />
Depending on your needs, you may want to add additional props, such as rotate or flip. You could simply add the classes directly to the component without using props if you’d like.
Most of our component’s content is CSS. Other than the spinning animation, most of this is used to make our SVG icon act more like an icon font¹. To align the icons to the text baseline, I’ve found that applying vertical-align: middle, along with a bottom margin of 0.125em, works for most cases. We also set the fill attribute value to currentColor, which allows us to color the icon just like text.
<p style="font-size: 2em; color: red;"> <svg-icon icon="exclamation-circle" /><!-- This icon will be 2em and red. --> Error! </p>
That’s it! If you want to use the icon component anywhere in your app without having to import it into every component that needs it, be sure to register the component in your main.js file:
// main.js import Vue from 'vue' import SvgIcon from '@/components/SvgIcon.vue' Vue.component('svg-icon', SvgIcon) // ...
Final thoughts
Here are a few ideas for improvements, which I intentionally left out to keep this solution approachable:
Scale icons that have non-square dimensions to maintain their proportions
Inject the SVG sprite into the page without needing an additional component.
Make it work with vite, which is a new, fast (and webpack-free) build tool from Vue creator Evan You.
Leverage the Vue 3 Composition API.
If you want to quickly take these components for a spin, I’ve created a demo app based on the default vue-cli template. I hope this helps you develop an implementation that fits your app’s needs!
¹ If you’re wondering why we’re using SVG when we want it to behave like an icon font, then check out the classic post that pits the two against one another.
The post A Font-Like SVG Icon System for Vue appeared first on CSS-Tricks.
You can support CSS-Tricks by being an MVP Supporter.
A Font-Like SVG Icon System for Vue published first on https://deskbysnafu.tumblr.com/
2 notes
·
View notes
Text
CSS Loaders
In this article we showcase some examples of progressbars, loading indicators and CSS spinners built purely with CSS Book shelf loader See the Pen #Codevember – Day 6 – Bookshelf loader by Grélard Antoine (@ikoshowa) on CodePen. Simple HTML and CSS loader See the Pen Loader by ...
#bootstrap loader css#CSS loader#css loader codepen#css loader generator#css loading spinner example#css preloader#css-loader npm#css-loader webpack#HTML and CSS loader#html page loader#javascript loader#jquery loader#style-loader#HTML / CSS
0 notes
Text
Create a custom work item control with Azure DevOps extension SDK
The Azure DevOps Web Extension SD or Azure DevOps Extension SDK is a client SDK for developing extensions for Azure DevOps. In this example I will show you how to make a custom work item control using this SDK.
Here is an example of a small project with a custom work item.
Prerequisites
We will need the following before we get started with building our extension:
NodeJS
Setting up the project
We start setting up the project by running the following NPM command in your project directory:
npm init
You can configure these settings as you wish. These can be found in package.json.
we need to install the following packages a dependencies:
npm i azure-devops-extension-api azure-devops-extension-sdk azure-devops-ui react react-dom
as well as the following dev dependencies:
npm i @types/react @types/react-dom copy-webpack-plugin cross-env css-loader loader-utils node-sass rimraf sass sass-loader style-loader tfx-cli ts-loader typescript webpack webpack-cli --save-dev
Now your package.json should look something like, the packager versions might be different:
{ "name": "testextension", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "azure-devops-extension-api": "^1.158.0", "azure-devops-extension-sdk": "^2.0.11", "azure-devops-ui": "^2.167.49", "react": "^16.14.0", "react-dom": "^16.14.0" }, "devDependencies": { "@types/react": "^18.0.25", "@types/react-dom": "^18.0.8", "copy-webpack-plugin": "^11.0.0", "cross-env": "^7.0.3", "css-loader": "^6.7.1", "loader-utils": "^3.2.0", "node-sass": "^7.0.3", "rimraf": "^3.0.2", "sass": "^1.56.0", "sass-loader": "^13.1.0", "style-loader": "^3.3.1", "tfx-cli": "^0.12.0", "ts-loader": "^9.4.1", "typescript": "^4.8.4", "webpack": "^5.74.0", "webpack-cli": "^4.10.0" } }
Create two directories inside your root directory: src and static. in this example we won’t be adding anything to the static folder, but it is meant for, for example image files that your project uses. For now, you can add a file named .gitkeep instead.
Next up is configuring TypeScript. Create tsconfig.json in your root folder and put the following inside it:
{ "compilerOptions": { "charset": "utf8", "experimentalDecorators": true, "module": "amd", "moduleResolution": "node", "noImplicitAny": true, "noImplicitThis": true, "strict": true, "target": "es5", "rootDir": "src/", "outDir": "dist/", "jsx": "react", "lib": [ "es5", "es6", "dom", "es2015.promise", "es2019" ], "types": [ "react", "node" ], "esModuleInterop": true } }
Now we configure Webpack. Create webpack.config.js in your root folder and put the following inside it:
const path = require("path"); const fs = require("fs"); const CopyWebpackPlugin = require("copy-webpack-plugin");
const entries = {};
const ComponentsDir = path.join(__dirname, "src/Components"); fs.readdirSync(ComponentsDir).filter(dir => { if (fs.statSync(path.join(ComponentsDir, dir)).isDirectory()) { entries[dir] = "./" + path.relative(process.cwd(), path.join(ComponentsDir, dir, dir)); } });
module.exports = { entry: entries, output: { filename: "[name]/[name].js" }, resolve: { extensions: [".ts", ".tsx", ".js"], alias: { "azure-devops-extension-sdk": path.resolve("node_modules/azure-devops-extension-sdk") }, }, stats: { warnings: false }, module: { rules: [ { test: /\.tsx?$/, loader: "ts-loader" }, { test: /\.s[ac]ss?$/, use: ["style-loader", "css-loader", "azure-devops-ui/buildScripts/css-variables-loader", "sass-loader"] }, { test: /\.css?$/, use: ["style-loader", "css-loader"], }, { test: /\.woff?$/, type: 'asset/inline' }, { test: /\.html?$/, loader: "file-loader" } ] }, plugins: [ new CopyWebpackPlugin({ patterns: [ �� { from: "**/*.html", context: "src/Components" } ] }) ] };
The last configuration we need to make is specifically for Azure DevOps extensions. Again, in the root directory, create a new file, this time it’s called azure-devops-extension.json:
{ "manifestVersion": 1.0, "id": "textextension", "publisher": "your Visual Studio Marketplace publisher here", "version": "0.0.1", "public": false, "name": "testextension", "description": "custom control", "categories": [ "Azure Boards" ], "targets": [ { "id": "Microsoft.VisualStudio.Services" } ], "icons": { "default": "logo.png" }, "content": { "details": { "path": "README.md" } }, "scopes": [ "vso.work" ], "files": [ { "path": "static", "addressable": true }, { "path": "dist", "addressable": true } ] }
Now, you might notice how this configuration file needs two files: README.md and logo.png. You can add these files in your root folder.
Making the custom control
inside the src directory, create a new React component, let’s name the file Common.tsx.
import "azure-devops-ui/Core/override.css" import "es6-promise/auto" import * as React from "react" import * as ReactDOM from "react-dom" import "./Common.scss"
export function showRootComponent(component: React.ReactElement<any>) { ReactDOM.render(component, document.getElementById("root")) }
It is important we import "azure-devops-ui/Core/override.css", so that we can use standardized UI styling.
This component is more or less our root component, which renders our other components inside a HTML element with id “root”.
Also create a Common.scss file. All we’re going to add to this is:
body { margin: 0; padding: 0; }
Inside the src folder, let’s make another directory named Components and inside that folder create another one named TestExtensionComponent.
src │ Common.scss │ Common.tsx │ └───Components └───TestExtensionComponent
Inside the TestExtensionComponent folder, we’re going to add a few files. First off is TestExtensionComponent.html, this will be our html that will contain the component(s) of your custom control.
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <body> <div id="root"></div> <script type="text/javascript" src="TestExtensionComponent.js" charset="utf-8"></script> </body> </html>
Next is TestExtensionComponent.scss.
@import "node_modules/azure-devops-ui/Core/_platformCommon.scss";
This will import the Azure DevOps styling.
Now add TestExtensionComponent.json, this is our component configuration file. Let’s add an input to the configuration, let’s call it SampleInput
{ "contributions": [ { "id": "TestExtensonComponent", "type": "ms.vss-work-web.work-item-form-control", "targets": [ "ms.vss-work-web.work-item-form" ], "properties": { "name": "cusom control", "uri": "dist/TestExtensonComponent/TestExtensonComponent.html", "inputs": [ { "id": "SampleInput", "name": "sample input", "description": "sample input", "validation": { "dataType": "String", "isRequired": true } } ] } } ], "scopes": [ "vso.work" ] }
Next is TestExtensionComponent.tsx
import React, { Component } from 'react' import * as SDK from "azure-devops-extension-sdk" import { IWorkItemFormService, WorkItemTrackingServiceIds, WorkItemOptions } from "azure-devops-extension-api/WorkItemTracking"
import "./TestExtensionComponent.scss"
import { showRootComponent } from "../../Common"
class TestExtensionComponent extends Component<{}, {}> {
constructor(props: {}) { super(props) }
public componentDidMount() { SDK.init({}) }
public render(): JSX.Element { return ( <></> ) } }
export default RESTRequestButton showRootComponent(<RESTRequestButton />)
The component doesn’t do much for now. What is important is the SDK.Init() inside the ComponentDidMount(). This makes sure we can use the Azure DevOps Extension SDK in our component.
So, what if we want to get input data? For example, our SampleInput we configured in the json. We can use the Azure DevOps Extension SDK for that.
To the constructor add:
this.state = { displayText: "default text", }
and to the Component after the extends keyword:
class TestExtensionComponent extends Component<{}, { displayText : string }>
SDK.Init() inside ComponentDidMount() is a Promise so, we can use then-chaining to set our state values there.
public componentDidMount() { SDK.init({}) .then( () => { this.setState({ displayText: SDK.getConfiguration().witInputs["SampleInput"] }) }) }
Now in our render() we can display the input data
public render(): JSX.Element { return ( <>{this.state.displayText}</> ) }
You might also want the data of the current Work Item, we can do this with the IWorkItemFormService interface.
const workItemFormService = await SDK.getService<IWorkItemFormService>( WorkItemTrackingServiceIds.WorkItemFormService )
Then we can use this to get specific fields
const fieldValues : Promise<{[fieldName: string]: Object}> = workItemFormService.getFieldValues(fields, options)
fields here is an array of strings containing key names of the work item, for example: System.Title, System.AssignedTo or Custom.HasPineapple
options is a class that implements WorkItemOptions, which can be done quite easily like
class Options implements WorkItemOptions { returnOriginalValue: boolean = true }
Now, the variablefieldValues is a Promise, so you can use then-chaining to get the data.
Say, we want to display the title of the work item instead on the SampleInput, we could modify our code to look like this:
public componentDidMount() { SDK.init({}) .then( () => { const workItemFormService = await SDK.getService<IWorkItemFormService>( WorkItemTrackingServiceIds.WorkItemFormService ) const fieldValues : Promise<{[fieldName: string]: Object}> = workItemFormService.getFieldValues(fields, options)
fieldValues.then( data =>
this.setState({ displayText: data["System.Title"] }) ) }) }
0 notes
Text
Anychart playground

#Anychart playground install#
#Anychart playground code#
#Anychart playground license#
Please look at our article Modules to start working with modules. Module systemĪn圜hart since v8.0.0 is structured as a modules, so you can use only what you need. Read more about using source maps in Chrome or source maps in Firefox.
#Anychart playground code#
Source map maps minified code to source code. An圜hart React plugin sample includes two parts: code of the plugin sample that allows to use Javascript library (in this case, An圜hart) with React Library. The -df option generates property renaming report, variable renaming report, and source map location mapping files: An圜hart Support An圜hart Playground An圜hart Documentation An圜hart API Reference An圜hart Sample Solutions An圜hart Integrations License. GitHub documentation: Forking repositories. Create a pull request against the develop branch. To create a dev build for the debug purposes use -d or -develop option: To contribute to An圜hart project please: Fork GraphicsJS repository. You can read more about modules in our Modules article. This compiles production version of anychart-bundle and all modules and puts them into the out folder. an example JSON from the An圜hart Playground into the source of the region.
#Anychart playground install#
To install all dependencies use the deps command:Īfter running this command you can compile the project using the compile command: There are many more options in An圜hart such as using specific events to. To see all available options of the build script use -h or -help command: Used to compile and minify An圜hart UI css.īuild.py python script is used to work with An圜hart project.
Google Closure Compiler - compiles JavaScript code to better JavaScript.
Google Closure Library - powerful, low-level JavaScript library.
GraphicsJS - High-performance SVG/VML drawing library.
After pull request is accepted the author of pull request sign over all rights to the code to An圜hart.Īn圜hart uses several third-party libraries and tools to work with JavaScript and CSS.
An圜hart bears no responsibility for the code written by third-party developers until pull request is accepted.
GitHub documentation: Collaborating using pull requests.
Create a pull request against the develop branch.
Make any changes you want to contribute.
Basically, it is a project similar to JSFiddle or CodePen but built specifically to handle An圜hart HTML5 charts right there and then easily share them.
Create a branch from the develop branch. An圜hart Playground is an online tool for testing and showcasing any HTML, CSS and JavaScript code.
Java Servlets, Maven, JDBC, JSP and MySQL If you are interested in a particular integration not listed here, please contact us.
#Anychart playground license#
These samples were created to demonstrate how An圜hart can be easily integrated into your environment.Īll examples are distributed under an Apache 2.0 License and can be customized to your application. Technical IntegrationsĪn圜hart can run on any platform and with any database. You can use An圜hart with any bundling tool or module loader such as WebPack, Browserify, Require.js and others.įor more details, take a look at An圜hart Webpack example. For more details, take a look at An圜hart ES6 example.

0 notes
Text
crypto trading bot개발시 부딛힌 selenium 관련 문제
내가 구성한 시스템의 경우
django를 기반으로 api기능, front end pages 를 유저에게 제공한다.
front end pages의 경우 react js를 통해 만들어져서 전달되고 데이터가 필요한 경우 django api를 이용하는 구성형태이다
javascript selenium를 사용하려고 처음에 생각했다.
.
.
.
Module not found: Error can't resolve 'child_process'
Module not found: Error can't resolve 'fs'
Module not found: Error can't resolve 'tls'
에러 발생 아래와 같이 문제 해결
package.json이나 webpack confic, babel config 화일을 조정해서 문제해결
버전에 따라 조정해야 하는 config화일이 달라진다.
https://stackoverflow.com/a/54459622
https://webpack.js.org/configuration/resolve/#resolvefallback
.
https://stackoverflow.com/a/67233156
.
.
.
그래서 selenium을 다운 받고 설치하고 webpack 으로 번들링 작업을 했지만 static property 부분에서 작업이 멈추고 지원할수 없는 화일이므로 알맞은 loader를 사용하라는 에러메시지가 떴다. (해결방법 못 찾음)
그 해결 과정에서 babel loader 기본 설정에서 사용되는 preset-env
@babel/preset-env
@babel/preset-env is a smart preset that allows you to use the latest JavaScript without needing to micromanage which syntax transforms (and optionally, browser polyfills) are needed by your target environment(s). This both makes your life easier and JavaScript bundles smaller!
실제 config 파일 사용예시는 아래에 있는 참고링크 참고
webpack5 config 설정 설명
https://youtu.be/9c3dBhvtt6o
.
.
static property 가 들어간 file번들링시 plugin-proposal-class-properties 필요할때도 있다. 일반적으로 최근 preset-env에 포함되어있는데 아닌 경우도 있을것 같아 아래 방법도 시도해 봤지만 실패
https://stackoverflow.com/a/60865451
.
.
.
문제해결을 위해 webpack 5로 업그레이드 시도했다.
webpack에 정보가 부족한듯 하여 webpack config기본 설정해 대한 유튜브 참고
이런경우 babel loader의 문제일수 있기 때문에 확인했지만 실패
결국 webpack 4로 돌아가고 selenium을 다운그레이드 했다.
이전의 문제는 해결되었지만 process.binding이 지원되지 않는 다는 새로운 에러 발생 (추측컨대 react js는 client 에서 돌아가는 작업들이기때문에 selenium을 이용하는 경우 사용자 컴퓨터를 마음대로 이용하게 될수도 있기 때문에 보안상 원천 봉쇄된걸로 파악)
그래서 server end에서 python selenium과 headless webdriver를 이용하기로 했다. react js(client side)에서는 api를 통해 작업을 요청하고 이용해서 결과 데이터를 받는 방향으로 결정
참고 링크
selenium docs https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/
.
selenim 이용해서 metamask조작하는 과정
https://dev.to/ltmenezes/automated-dapps-scrapping-with-selenium-and-metamask-2ae9
.
webpack 5 config file example
https://youtu.be/9c3dBhvtt6o 에서 전반적인 설명
https://gist.github.com/prof3ssorSt3v3/3e5fcbfae9ba28b5816fd93a074e65bd
const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { mode: 'development', //production entry: { main: path.resolve(__dirname, 'src/app.js'), }, output: { path: path.resolve(__dirname, 'dist'), filename: '[name].[contenthash].js', assetModuleFilename: '[name][ext]', clean: true, }, devtool: 'inline-source-map', devServer: { static: path.resolve(__dirname, 'dist'), port: 5001, //default 8080 open: true, hot: true, }, //loaders module: { rules: [ //css { test: /\.css$/, use: ['style-loader', 'css-loader'] }, //images { test: /\.(svg|ico|png|webp|jpg|gif|jpeg)$/, type: 'asset/resource' }, //js for babel { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'], }, }, }, ], }, //plugins plugins: [ new HtmlWebpackPlugin({ title: 'Just a Demo', filename: 'index.html', template: path.resolve(__dirname, 'src/temp.html'), }), ], };
0 notes
Text
Multiple Entry Points in Webpack with Mini CSS Extract Plugin
Here is the case I stacked.
First of all, if you want to use multiple entry points with Webpack, you can use glob like this
var glob = require("glob"); var entries = {}; glob.sync("./scss/*.scss", {ignore: './scss/_*.scss'}).map(function (file) { const regEx = new RegExp('./scss/'); const key = file.replace(regEx, ''); entries[key] = file; }); module.exports = { entry: entries, ...
Next, since you are using MCEP, you don't need "output" option. I completely stacked cause I didn't doubt about existing "output" option.
Here is my webpack.config.js so far.
var webpack = require('webpack'); var path = require('path'); var MiniCssExtractPlugin = require("mini-css-extract-plugin"); var OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); var SpriteLoaderPlugin = require('svg-sprite-loader/plugin'); var glob = require("glob"); var jsConfig = { entry: './js/index.js', output: { path: path.join(__dirname,'./dist'), filename: 'main.js' }, mode: 'development', devServer: { contentBase: './', open: true }, plugins: [ new webpack.ProvidePlugin({ $: 'jquery', jQuery: "jquery" }), new SpriteLoaderPlugin({ plainSprite: true }) ], module: { rules: [ { test: /\.svg$/, loader: 'svg-sprite-loader', options: { extract: true, spriteFilename: './images/icons.svg', runtimeCompat: true } } ] } }; var entries = {}; glob.sync("./scss/*.scss", {ignore: './scss/_*.scss'}).map(function (file) { const regEx = new RegExp('./scss/'); const key = file.replace(regEx, ''); entries[key] = file; }); var cssConfig = { entry: entries, //entry: './scss/default.scss', // output: { // path: path.join(__dirname, './dist'), // filename: "[name].css" // }, mode: 'development', // devtool: 'source-map', devServer: { contentBase: './', open: true }, plugins: [ new MiniCssExtractPlugin({ filename: '[name].css', chunkFilename: "[id].css", }), new OptimizeCSSAssetsPlugin({ assetNameRegExp: /\.css$/g, cssProcessor: require('cssnano'), cssProcessorOptions: { safe: true, discardComments: { removeAll: true } }, canPrint: true }) ], module: { rules: [ { test: /\.scss$/, use: [ MiniCssExtractPlugin.loader, {loader: 'css-loader', options:{url: false}}, 'sass-loader' ] }, { test: /\.(eot|svg|ttf|woff|woff2)$/, use: ['file-loader?name=public/fonts/[name].[ext]'] } ] } }; module.exports = [jsConfig, cssConfig];
1 note
·
View note
Text
Some important CSS and JS Libraries
1. Styled components
An idea born in an Australian whisky bar has developed into a project of 18 K stars, widely embraced within the culture. Styled components make it simpler to use CSS in React components, by identifying styled components with encapsulated styles as a mediator layer without CSS classes. Styled-components are generated by literal notation using the ES6 framework to describe components. As you would normally do using CSS, CSS properties can be applied to the component as required. Styled components can create specific class names when the JS is parsed, and inject the CSS into the DOM. You will learn more about Max Stoiber in this great chat.
2. Radium
Radium is described as "A toolchain for React component styling" at 6.5 K stars and developed by FormidableLabs. With React without CSS, it's a collection of tools to handle inline types. Radium provides a simple interface and abstractions to manage CSS features that can not easily accommodate Radium inline styles, enabling you to bundle styles together with your React elements, combining javascript, html, and styling. It also provides rendering based on props, allowing you to design your components according to the state of your game.
3. AphroditeAphrodite is a framework-agnostic CSS-in-JS library with server-side rendering support, browser prefixing and limited CSS generation support. Aphrodite transforms everything into classes, using the class attribute.This project operates with or without Respond at 4 K stars and offers features such as modeled injection into the Dom, styles of auto prefixes and more, all at a fairly small size of 20k and a handful of dependencies. Here's a handy rundown of Aphrodite vs. Radium. 4. Emotion
At 4.2 K stars Emotion is a strong and versatile CSS-in-JS library that enables you to style string or object-based apps. To prevent variance problems with CSS it has uniform structure. Based on the glam library and its philosophy the concept is to maintain runtime output by parsing styles with babel and PostCSS while writing CSS. The core runtime is 2.3 kb, and 4 kb with support from React. Emotion isn't just about Reacting.
5. Glamorous
Note: the project is no longer actively maintained! still cool though :)
At 3.6 K stars, PayPal's Glamorous is focused to create styled components and jsxtyle inspired "maintainable CSS with React." Kent C. Dodds describes the project as "React component styling with an elegant (inspired) API, small footprint (< 5 kb gzipped) and great performance (through glamour)." It has a rather similar API to modeled parts, and under the hood it uses similar methods.
6. Glamor
Glamor, inspired by ideas from this great talk, is small and powerful. It helps you to write CSS inline in your components using the same supports for style prop Object CSS syntax React. It is fast and efficient, independent system, serverside / static rendering and adds vendor prefixes / fallback values. Here's a short introductory API notes, a comparison of Glamor CSS techniques and a helpful Glamor tutorial with Gatsby.
7. Fela
<FelaComponent style={{ backgroundColor: 'blue', color: 'red' }} render={({ className, theme }) => ( <div className={className}>I am red on blue.</div> )} />
Fela is a project developed in JavaScript for State-Driven Styling, highlighting 3 things: rendering styling dynamic by design, introducing framework-agnostic (Bindings for Reacting) and performing. Based on the state of the application it is adjustable by nature and renders types. It generates atomic CSS and supports all common features of CSS such as media queries, pseudo-classes, keyframes and font faces. It can be used on any view list, including the native React.
8. Styletron
Thanks to this
code-carrot post
Styletron is a "component-oriented styling toolkit" at 2500 stars. Styletron supports stateless, single-element styled components as primitive base styling with conditional / dynamic styling prop interfaces, and style composition via (typed) JavaScript objects without additional tooling (e.g. Webpack loaders, Babel plugins, etc.). The design of style objects is often un-opinioned on. This fascinating HN thread lets you know more.
9. JSSJSS is a CSS abstraction that uses JavaScript to define styles in a declarative and maintenable manner. It is a high performance compiler JS to CSS that operates both runtime and server-side. This core library is agnostic at low level and frame, and is around 6 KB (minified and gzipped). This can also be expanded by API plugins. Here's a good SCSS (Sass) conversion tutorial here. Test out even React-JSS, a React JSS integration.
10.
Bootstrap Icons
For their icon library the Bootstrap team recently published the Alpha 3 Update. The newest update adds tons of new designs and now has over 500 icons on the Bootstrap SVG icon pack. Bootstrap Icons are designed to interact with components in Bootstrap, from shape controls to navigation. Bootstrap icons are SVGs, so they can easily and quickly scale and be styled with CSS. Although built for Bootstrap, they will work in any project. They are open source (MIT), so you can access, use, and expand it free of charge. Heads up though, right now they are in alpha and open to drastic changes.
11.
Polka
This is my short analysis of Polka which is "... just a native HTTP server with added routing, middleware, and sub-applications support ...!" even though express is relatively light, polka is lighter. What I find fascinating in this approach gives you even more insight into how to build an application. I think Polka is an excellent way to express yourself. With only a few extra modules, you'll have a fully fledged system with stable paths, templating, static files providing in a more lightweight (and hopefully faster) bundle all you have in express. It has not the same express acceptance but this could be an advantage.
12.
Size limit
Open-source tool to measure the performance of JS apps that offers an estimation of how much time end-users will need to run your Javascript. It can be plugged into Travis CI, Circle CI, GitHub Behavior so it runs automatically and prevents over-budget size limit commits.
13.
Stryker
Stryker is a very fascinating project in JavaScript and other languages to run mutation testing. It works by adding "mutations" to the code and running tests on them in random locations, testing how many of the mutations pass and how stable the code really is. By an example let's explain this, Suppose you're creating an online casino. Users are only permitted to access the casino if they are over 18. So you write the following piece of code to test if anyone can access the site:
function isUserOldEnough(user) { return user.age >= 18; }
Stryker will find the return statement and decide to change it in several ways:
/* 1 */ return user.age > 18; /* 2 */ return user.age < 18; /* 3 */ return false; /* 4 */ return true;
We call such shifts mutants. After discovering the mutants, they are introduced one by one and the experiments are performed against them. If at least one of the experiments fails, we're saying the mutant is murdered. This is what we want to see! If no check fails, then it has succeeded. The better the experiments survive the fewer mutants.Stryker produces the results in various formats. One of the easiest reporters to read is the plain text:
Mutant killed: /yourPath/yourFile.js: line 10:27 Mutator: BinaryOperator - return user.age >= 18; + return user.age > 18; Mutant survived: /yourPath/yourFile.js: line 10:27 Mutator: RemoveConditionals - return user.age >= 18; + return true;
The direct text reporter outputs precisely how the code has been changed and which mutator has been used. It would then tell us whether a mutant has been killed which means that at least one test has failed, or whether it has survived. In this case the second mutation is marked as survivor. This means that a test that specifically checks for age younger than 18 is possibly lacking
14.
Dinero.js
Dinero is a JavaScript library designed to work with monetary values. It has a well-designed API which contains all the methods for money and currency operations you might need. Dinero.js allows the development, estimation and formatting of monetary values in JavaScript. You can do arithmetic operations, read and format them thoroughly, search for a variety of items to make your own creation process simpler and safer.
15.
Uppload
Uppload.js is a modern JavaScript library designed to enhance the experience of uploading images. The library offers an elegant interface for file collection that allows the user to drag-drop images from the locale.It also allows you to import images from any data source, such as URL, camera, Instagram post, Facebook public post, etc. Thanks to its plugin program, it provides multiple upload options, allowing you to add more image sources, such as Instagram, screenshots, Giphy and more.You are also allowed to crop, resize, rotate the client-side images until they are submitted to server.
16.
MoreToggels
Pure CSS library offering over 50 stylish checkbox toggles of a pleasant variety. These are very easy to use and customize-only surround a div in your checkbox, add the right class and it's done.
17.
μPlot
Fast, memory-efficient diagram library to generate superb 2D Canvas-based charts. It offers lots of different types of graphs, lots of customization options and other cool features.
18.
Rsup Progress
Easy but still very successful progress bar plugin with promising support and smooth animations. It is super easy to configure and very useful to show the load times at the top of the page. 19.
Bootstrap Treeview
Bootstrap treeview is used to represent hierarchical information starting with the root element and continuing with its children and their respective items. Besides the root every element has a parent and can have children. Easy Bootstrap 4 plugin designed to build elegant treeviews with collapse list objects. It's a fantastic little feature and we wouldn't be shocked to see it integrated with future Bootstrap models. Siblings are objects with one parent and the same. Objects can collapse and expand.
20.
Electron React Boilerplate
Electron React Boilerplate uses Electron, React, Redux, React Router, Webpack and React Hot Loader for rapid application creation (HMR).Great starting kit for the production of Electron-based cross-platform mobile applications. The project GitHub provides a strong framework to help you customize everything and get started in no time.
21.
Panolens
They're panolens. Js is a WebGL focused and event-driven panoramic viewer. Lean and versatile. It is constructed over Three. Amazing JavaScript panorama viewer library right in the browser to create beautiful 360 ° experience. Three.js-based library keeps output fast and smooth, even when viewing high quality images or videos.
22.
Octomments
Very smart solution for adding comments to your website which uses GitHub as a discussion source. The project consists of a GitHub App and a JS library working together to view a fully featured comment section, hosted within a selected repo issue of GitHub.
23.
Rome
Rome is a toolchain experimental to JavaScript. It includes a parser, linter, formatter, bundler, frame checking and more. It aims to be a detailed platform for everything that relates to JavaScript source code production. Rome is not a set of known instruments. All the tools are designed specifically for Rome, do not rely on any external dependencies and are made to communicate with each other seamlessly.
24.
massCode
MassCode is a snippet manager for developers of open-source code. This nice little app offers a clean interface for all of your code snippets and cheatsheets to handle. Runs on Mac, Linux and Windows.
25.
Bootlint
The Bootstrap team's new linter tool that lets you test if your pages use Bootstrap's components with properly organized HTML. It also ensures the appropriate tags are used, an HTML5 doctype declaration is included, and the page's overall markup is accurate.
26.
DarkModeJS
This library uses the mix-blend-mode css to get Dark Mode on all of your websites. Only copy and paste the snippet and you'll get a plugin to turn the Dark Mode on and off. You can also use it programmatically, without the button. Lightweight module, installed in Vanilla. Super lightweight JS library to help you integrate dark & light teams into your applications. It senses local time for the user and changes the UI appearance accordingly. It doesn't have light and dark themes.
27.
Hex Engine
Modern 2D engine designed to render browser games. This versatile toolkit for game development features a Canvas-based rendering engine, aids in physics and sound, gamepad support, integrated design tools, and more.
28.
Chardin.js
A tiny JS tool which makes adding overlay instructions for your apps super simple. These guides can be extremely helpful to clarify the UI, demote the various features of the app or simply show the user what to do next.
29.
Sharect
Share. Js is a lightweight, zero-dependent JS library that transforms any text selected into quotes that can be posted on Twitter and/or Facebook, as you can see in Medium.com.
30.
Lottie
Lottie is an Android, iOS, Web, and Windows library that parses Adobe After Effects animations exported as json with Bodymovin and makes them natively accessible on the smartphone and on the web! The Airbnb developer team's incredible library that exports Adobe After. This makes animations that can be very complex with lots of details and keyframes as well as being super-performing and smooth buttery. It's now designed to expand its use to android, iOS, React Native and Windows in addition to his great work.
31.
Vue Interactive Paycard
View-Interactive-Paycard-Smooth and sweet micro-interaction credit card shape. Includes the printing of numbers, validation and automatic identification of type of token. Designed with viewjs, and completely sensitive as well. Very impressive credit card snippet type which beautifully animates as users input their data. One of the finest projects we've seen all year round, with everything polished to perfection, from the typography to the animations. It's not only pretty either-the card is also very user friendly with the formatting of numbers, validation and the identification of card size. Also, when entering cc info, users actually prefer a well-known interface and not some custom UI.
32.
Cube.js
Cube.js is a scalable open source platform for building analytical web applications and designing your own sophisticated, custom analytics systems. It consists of a wide SDK frontend and a lightweight API backend which can be linked to most databases and systems like MySQL, Postreges and MongoDB .. It is primarily used for developing internal business intelligence tools or for applying customer-facing analytics to an existing app.
33.
Tessaract
Tesseract. Js is the pure Javascript port of Tesseract's popular OCR engine. Node and browser JavaScript library which extracts text from images. It analyzes the image, automatically detects location and orientation of the text, and with great precision extracts words and sentences. Tessaract can recognize more than 60 languages including more complex ones such as Chinese, Arabic and Russian
34.
Barba
Lightweight library for linking seamless transitions to pages on your website. It takes up your usual static website and makes it a great-looking single-page application experience. It helps to reduce the delay between loading pages, to decrease requests for HTTP, and to make the web feel more premium.
35.
Freezeframe
This fun JavaScript library allows for the control of animated GIF playback. It can start and pause the GIFs, for example, based on user feedback such as clicks or hover. As it uses a canvas feature to draw the individual frames, it is also very performant under the hood.
36.
Ink
React-based App building command line interface. It provides a great range of predefined components which can be used to accelerate the creation of terminal interfaces while also allowing features such as more sophisticated templates and controls to be added.
37.
Instant Page
This fun library speeds up loading times when users hover over them by prefretching the links. This makes loading of a page faster until the user clicks on a connection and navigates to the next page. With the latest update it can also automatically prefix all links in a list-great for static content.
38.
Filepond
FilePond is a JavaScript library that lets you upload silky smooth drag n 'drop files. It has a polished UI which is a pleasure to use, while also offering some interesting features under the hood such as optimizing photos for quicker uploads. Just 21 kB gzipped, with adapters available with React, Vue, and jQuery for easier implementation. These docs can assist in downloading, setting up, updating and extending FilePond. If you don't know FilePond you can find more detail on the FilePond product page.
39.
Micromodal
Micromodalistic. Js is a modal library written in pure JavaScript, lightweight, configurable and 11y-enabled. It helps you to build modal dialogs consistent with WAI-ARIA guidelines, with trust and with minimal configuration. Minified and gzipped at just 1.9 kb, it's a tiny library for big change.
40.
Brain.js
A great project for all of you who want to take their first steps in machine learning, Brain.js offers a powerful framework for working in a JavaScript environment with the neural networks. It has lots of examples of excellent documentation that will help you understand some of the most important ML techniques.
As a reputed Software Solutions Developer we have expertise in providing dedicated remote and outsourced technical resources for software services at very nominal cost. Besides experts in full stacks We also build web solutions, mobile apps and work on system integration, performance enhancement, cloud migrations and big data analytics. Don’t hesitate to
get in touch with us!
Source:
whizzystack.co
#b2b ecommerce
#b2b content marketing
#b2b seo
#Ecommerce
#socialmediamarketing
0 notes
Text
Some important CSS and JS Libraries
1. Styled components
An idea born in an Australian whisky bar has developed into a project of 18 K stars, widely embraced within the culture. Styled components make it simpler to use CSS in React components, by identifying styled components with encapsulated styles as a mediator layer without CSS classes. Styled-components are generated by literal notation using the ES6 framework to describe components. As you would normally do using CSS, CSS properties can be applied to the component as required. Styled components can create specific class names when the JS is parsed, and inject the CSS into the DOM. You will learn more about Max Stoiber in this great chat.
2. Radium
Radium is described as "A toolchain for React component styling" at 6.5 K stars and developed by FormidableLabs. With React without CSS, it's a collection of tools to handle inline types. Radium provides a simple interface and abstractions to manage CSS features that can not easily accommodate Radium inline styles, enabling you to bundle styles together with your React elements, combining javascript, html, and styling. It also provides rendering based on props, allowing you to design your components according to the state of your game.
3. AphroditeAphrodite is a framework-agnostic CSS-in-JS library with server-side rendering support, browser prefixing and limited CSS generation support. Aphrodite transforms everything into classes, using the class attribute.This project operates with or without Respond at 4 K stars and offers features such as modeled injection into the Dom, styles of auto prefixes and more, all at a fairly small size of 20k and a handful of dependencies. Here's a handy rundown of Aphrodite vs. Radium. 4. Emotion
At 4.2 K stars Emotion is a strong and versatile CSS-in-JS library that enables you to style string or object-based apps. To prevent variance problems with CSS it has uniform structure. Based on the glam library and its philosophy the concept is to maintain runtime output by parsing styles with babel and PostCSS while writing CSS. The core runtime is 2.3 kb, and 4 kb with support from React. Emotion isn't just about Reacting.
5. Glamorous
Note: the project is no longer actively maintained! still cool though :)
At 3.6 K stars, PayPal's Glamorous is focused to create styled components and jsxtyle inspired "maintainable CSS with React." Kent C. Dodds describes the project as "React component styling with an elegant (inspired) API, small footprint (< 5 kb gzipped) and great performance (through glamour)." It has a rather similar API to modeled parts, and under the hood it uses similar methods.
6. Glamor
Glamor, inspired by ideas from this great talk, is small and powerful. It helps you to write CSS inline in your components using the same supports for style prop Object CSS syntax React. It is fast and efficient, independent system, serverside / static rendering and adds vendor prefixes / fallback values. Here's a short introductory API notes, a comparison of Glamor CSS techniques and a helpful Glamor tutorial with Gatsby.
7. Fela
<FelaComponent style={{ backgroundColor: 'blue', color: 'red' }} render={({ className, theme }) => ( <div className={className}>I am red on blue.</div> )} />
Fela is a project developed in JavaScript for State-Driven Styling, highlighting 3 things: rendering styling dynamic by design, introducing framework-agnostic (Bindings for Reacting) and performing. Based on the state of the application it is adjustable by nature and renders types. It generates atomic CSS and supports all common features of CSS such as media queries, pseudo-classes, keyframes and font faces. It can be used on any view list, including the native React.
8. Styletron
Thanks to this
code-carrot post
Styletron is a "component-oriented styling toolkit" at 2500 stars. Styletron supports stateless, single-element styled components as primitive base styling with conditional / dynamic styling prop interfaces, and style composition via (typed) JavaScript objects without additional tooling (e.g. Webpack loaders, Babel plugins, etc.). The design of style objects is often un-opinioned on. This fascinating HN thread lets you know more.
9. JSSJSS is a CSS abstraction that uses JavaScript to define styles in a declarative and maintenable manner. It is a high performance compiler JS to CSS that operates both runtime and server-side. This core library is agnostic at low level and frame, and is around 6 KB (minified and gzipped). This can also be expanded by API plugins. Here's a good SCSS (Sass) conversion tutorial here. Test out even React-JSS, a React JSS integration.
10.
Bootstrap Icons
For their icon library the Bootstrap team recently published the Alpha 3 Update. The newest update adds tons of new designs and now has over 500 icons on the Bootstrap SVG icon pack. Bootstrap Icons are designed to interact with components in Bootstrap, from shape controls to navigation. Bootstrap icons are SVGs, so they can easily and quickly scale and be styled with CSS. Although built for Bootstrap, they will work in any project. They are open source (MIT), so you can access, use, and expand it free of charge. Heads up though, right now they are in alpha and open to drastic changes.
11.
Polka
This is my short analysis of Polka which is "... just a native HTTP server with added routing, middleware, and sub-applications support ...!" even though express is relatively light, polka is lighter. What I find fascinating in this approach gives you even more insight into how to build an application. I think Polka is an excellent way to express yourself. With only a few extra modules, you'll have a fully fledged system with stable paths, templating, static files providing in a more lightweight (and hopefully faster) bundle all you have in express. It has not the same express acceptance but this could be an advantage.
12.
Size limit
Open-source tool to measure the performance of JS apps that offers an estimation of how much time end-users will need to run your Javascript. It can be plugged into Travis CI, Circle CI, GitHub Behavior so it runs automatically and prevents over-budget size limit commits.
13.
Stryker
Stryker is a very fascinating project in JavaScript and other languages to run mutation testing. It works by adding "mutations" to the code and running tests on them in random locations, testing how many of the mutations pass and how stable the code really is. By an example let's explain this, Suppose you're creating an online casino. Users are only permitted to access the casino if they are over 18. So you write the following piece of code to test if anyone can access the site:
function isUserOldEnough(user) { return user.age >= 18; }
Stryker will find the return statement and decide to change it in several ways:
/* 1 */ return user.age > 18; /* 2 */ return user.age < 18; /* 3 */ return false; /* 4 */ return true;
We call such shifts mutants. After discovering the mutants, they are introduced one by one and the experiments are performed against them. If at least one of the experiments fails, we're saying the mutant is murdered. This is what we want to see! If no check fails, then it has succeeded. The better the experiments survive the fewer mutants.Stryker produces the results in various formats. One of the easiest reporters to read is the plain text:
Mutant killed: /yourPath/yourFile.js: line 10:27 Mutator: BinaryOperator - return user.age >= 18; + return user.age > 18; Mutant survived: /yourPath/yourFile.js: line 10:27 Mutator: RemoveConditionals - return user.age >= 18; + return true;
The direct text reporter outputs precisely how the code has been changed and which mutator has been used. It would then tell us whether a mutant has been killed which means that at least one test has failed, or whether it has survived. In this case the second mutation is marked as survivor. This means that a test that specifically checks for age younger than 18 is possibly lacking
14.
Dinero.js
Dinero is a JavaScript library designed to work with monetary values. It has a well-designed API which contains all the methods for money and currency operations you might need. Dinero.js allows the development, estimation and formatting of monetary values in JavaScript. You can do arithmetic operations, read and format them thoroughly, search for a variety of items to make your own creation process simpler and safer.
15.
Uppload
Uppload.js is a modern JavaScript library designed to enhance the experience of uploading images. The library offers an elegant interface for file collection that allows the user to drag-drop images from the locale.It also allows you to import images from any data source, such as URL, camera, Instagram post, Facebook public post, etc. Thanks to its plugin program, it provides multiple upload options, allowing you to add more image sources, such as Instagram, screenshots, Giphy and more.You are also allowed to crop, resize, rotate the client-side images until they are submitted to server.
16.
MoreToggels
Pure CSS library offering over 50 stylish checkbox toggles of a pleasant variety. These are very easy to use and customize-only surround a div in your checkbox, add the right class and it's done.
17.
μPlot
Fast, memory-efficient diagram library to generate superb 2D Canvas-based charts. It offers lots of different types of graphs, lots of customization options and other cool features.
18.
Rsup Progress
Easy but still very successful progress bar plugin with promising support and smooth animations. It is super easy to configure and very useful to show the load times at the top of the page. 19.
Bootstrap Treeview
Bootstrap treeview is used to represent hierarchical information starting with the root element and continuing with its children and their respective items. Besides the root every element has a parent and can have children. Easy Bootstrap 4 plugin designed to build elegant treeviews with collapse list objects. It's a fantastic little feature and we wouldn't be shocked to see it integrated with future Bootstrap models. Siblings are objects with one parent and the same. Objects can collapse and expand.
20.
Electron React Boilerplate
Electron React Boilerplate uses Electron, React, Redux, React Router, Webpack and React Hot Loader for rapid application creation (HMR).Great starting kit for the production of Electron-based cross-platform mobile applications. The project GitHub provides a strong framework to help you customize everything and get started in no time.
21.
Panolens
They're panolens. Js is a WebGL focused and event-driven panoramic viewer. Lean and versatile. It is constructed over Three. Amazing JavaScript panorama viewer library right in the browser to create beautiful 360 ° experience. Three.js-based library keeps output fast and smooth, even when viewing high quality images or videos.
22.
Octomments
Very smart solution for adding comments to your website which uses GitHub as a discussion source. The project consists of a GitHub App and a JS library working together to view a fully featured comment section, hosted within a selected repo issue of GitHub.
23.
Rome
Rome is a toolchain experimental to JavaScript. It includes a parser, linter, formatter, bundler, frame checking and more. It aims to be a detailed platform for everything that relates to JavaScript source code production. Rome is not a set of known instruments. All the tools are designed specifically for Rome, do not rely on any external dependencies and are made to communicate with each other seamlessly.
24.
massCode
MassCode is a snippet manager for developers of open-source code. This nice little app offers a clean interface for all of your code snippets and cheatsheets to handle. Runs on Mac, Linux and Windows.
25.
Bootlint
The Bootstrap team's new linter tool that lets you test if your pages use Bootstrap's components with properly organized HTML. It also ensures the appropriate tags are used, an HTML5 doctype declaration is included, and the page's overall markup is accurate.
26.
DarkModeJS
This library uses the mix-blend-mode css to get Dark Mode on all of your websites. Only copy and paste the snippet and you'll get a plugin to turn the Dark Mode on and off. You can also use it programmatically, without the button. Lightweight module, installed in Vanilla. Super lightweight JS library to help you integrate dark & light teams into your applications. It senses local time for the user and changes the UI appearance accordingly. It doesn't have light and dark themes.
27.
Hex Engine
Modern 2D engine designed to render browser games. This versatile toolkit for game development features a Canvas-based rendering engine, aids in physics and sound, gamepad support, integrated design tools, and more.
28.
Chardin.js
A tiny JS tool which makes adding overlay instructions for your apps super simple. These guides can be extremely helpful to clarify the UI, demote the various features of the app or simply show the user what to do next.
29.
Sharect
Share. Js is a lightweight, zero-dependent JS library that transforms any text selected into quotes that can be posted on Twitter and/or Facebook, as you can see in Medium.com.
30.
Lottie
Lottie is an Android, iOS, Web, and Windows library that parses Adobe After Effects animations exported as json with Bodymovin and makes them natively accessible on the smartphone and on the web! The Airbnb developer team's incredible library that exports Adobe After. This makes animations that can be very complex with lots of details and keyframes as well as being super-performing and smooth buttery. It's now designed to expand its use to android, iOS, React Native and Windows in addition to his great work.
31.
Vue Interactive Paycard
View-Interactive-Paycard-Smooth and sweet micro-interaction credit card shape. Includes the printing of numbers, validation and automatic identification of type of token. Designed with viewjs, and completely sensitive as well. Very impressive credit card snippet type which beautifully animates as users input their data. One of the finest projects we've seen all year round, with everything polished to perfection, from the typography to the animations. It's not only pretty either-the card is also very user friendly with the formatting of numbers, validation and the identification of card size. Also, when entering cc info, users actually prefer a well-known interface and not some custom UI.
32.
Cube.js
Cube.js is a scalable open source platform for building analytical web applications and designing your own sophisticated, custom analytics systems. It consists of a wide SDK frontend and a lightweight API backend which can be linked to most databases and systems like MySQL, Postreges and MongoDB .. It is primarily used for developing internal business intelligence tools or for applying customer-facing analytics to an existing app.
33.
Tessaract
Tesseract. Js is the pure Javascript port of Tesseract's popular OCR engine. Node and browser JavaScript library which extracts text from images. It analyzes the image, automatically detects location and orientation of the text, and with great precision extracts words and sentences. Tessaract can recognize more than 60 languages including more complex ones such as Chinese, Arabic and Russian
34.
Barba
Lightweight library for linking seamless transitions to pages on your website. It takes up your usual static website and makes it a great-looking single-page application experience. It helps to reduce the delay between loading pages, to decrease requests for HTTP, and to make the web feel more premium.
35.
Freezeframe
This fun JavaScript library allows for the control of animated GIF playback. It can start and pause the GIFs, for example, based on user feedback such as clicks or hover. As it uses a canvas feature to draw the individual frames, it is also very performant under the hood.
36.
Ink
React-based App building command line interface. It provides a great range of predefined components which can be used to accelerate the creation of terminal interfaces while also allowing features such as more sophisticated templates and controls to be added.
37.
Instant Page
This fun library speeds up loading times when users hover over them by prefretching the links. This makes loading of a page faster until the user clicks on a connection and navigates to the next page. With the latest update it can also automatically prefix all links in a list-great for static content.
38.
Filepond
FilePond is a JavaScript library that lets you upload silky smooth drag n 'drop files. It has a polished UI which is a pleasure to use, while also offering some interesting features under the hood such as optimizing photos for quicker uploads. Just 21 kB gzipped, with adapters available with React, Vue, and jQuery for easier implementation. These docs can assist in downloading, setting up, updating and extending FilePond. If you don't know FilePond you can find more detail on the FilePond product page.
39.
Micromodal
Micromodalistic. Js is a modal library written in pure JavaScript, lightweight, configurable and 11y-enabled. It helps you to build modal dialogs consistent with WAI-ARIA guidelines, with trust and with minimal configuration. Minified and gzipped at just 1.9 kb, it's a tiny library for big change.
40.
Brain.js
A great project for all of you who want to take their first steps in machine learning, Brain.js offers a powerful framework for working in a JavaScript environment with the neural networks. It has lots of examples of excellent documentation that will help you understand some of the most important ML techniques.
As a reputed Software Solutions Developer we have expertise in providing dedicated remote and outsourced technical resources for software services at very nominal cost. Besides experts in full stacks We also build web solutions, mobile apps and work on system integration, performance enhancement, cloud migrations and big data analytics. Don’t hesitate to
get in touch with us!
0 notes
Text
Export webpack packages as ES5 modules
Webpack often has powerful, but also non-standard, loaders. So you can load CSS, SASS or HTML right into your applicationpackage. But when you load your package into another, these depending packages cannot work with your non-standard imports.
The alternative is to import an exported module. To do so, you can use webpack (any version after 5.28 should work) and add an export as es6 module.
Here's an example of how your webpack.config.json would look:
const path = require('path'); module.exports = [ { entry: {...}, target: "web", output: {...}, module: {...} }, { experiments: { outputModule: true, }, externals: { 'libraries-you-use' : 'commonjs2 library-name' }, entry: {...}, target: "es6", output: { filename: '[name].node.js', chunkFilename: '[name].node.bundle.js', path: path.resolve(__dirname, 'dist'), libraryTarget: 'module' }, module: {...} }, ]
I often extract some of the repeating settings as variables, so it gets easier to build a configuration that makes sense.
Also note that the code I ommitted with ... is just ommitted because it stays the same accross my uses.
0 notes
Text
Simplify Static Asset Management With Vue.js Single-File Component

Static asset management is one of the more painful and mysterious challenges front-end developers face. We want our source code to be simple to develop and maintain, but we rely on browsers to be lean and mean. Browsers can’t be expected to understand our fancy source files with conveniences like Sass or the newest bleeding edge JavaScript features. We configure transpilers, linters, and compressors that watch for source code changes or get triggered by build processes. And finally, these tools emit static assets that a browser can interpret

Even when we don’t use fancy preprocessors, we still copy the source files to a dist directory to deploy them…because…well…it’s just what we do!

On top of this complexity, we have traditionally maintained a separation of concerns between markup, scripting, and styling. This separation can lead to extreme bloat that makes our applications difficult to maintain.
Imagine a request to remove a component from a view. You remove the markup…but can you track down CSS selectors that are specific to this component? All the media queries? Do you feel safe removing code that may affect other parts of the view? What about a request to modify a component’s appearance? Do you add a new class to your updated component and leave the old styling behind, just in case there are other parts of the view that are styled by it? Technical debt accumulates. Eventually, you have a pile of dead code mixed in with the good stuff. It’s very difficult to clean up, and nobody wants to pay for the effort.

Not to imply that your code is inherently bad. It’s a consequence of the separation of concerns that has made the internet look sharp since the W3C adopted CSS in 1996.
So, what are our alternatives? Inline CSS? An occasional inline style attribute is acceptable in the 21st century. But even with CSS-in-JS libraries, this solution can be challenging to scale. We need the cascade. We need media queries.
Many modern frameworks combine JavaScript with markup; it’s the core of the React, Angular, and Vue.js revolution. The concept of “styled components” is also trending. But unification usually comes at a cost. The learning curve, awkward code structure, and dependency on 3rd party libraries may outweigh the advantages. However, Vue’s out-of-the-box support for the concept makes it simple to grasp and implement.

The Vue.js framework Single-File Component (SFC) allows you to combine templating, scripting, and styling in a single source file that can accept props and manage state. Vue CLI — the “beginner” installation of Vue.js — will pre-configure the bridge between your .vue source files and webpack that requires absolutely no configuration or webpack knowledge. Let’s open a terminal and quickly build a working example using npm.
1.Install Vue CLI: npm install -g @vue/cli
2.Create a new project (accept the default settings): vue create vue-sfc-example
3.Start the project: npm run serve
4. Render HelloWorld.vue in a browser: http://localhost:8080

SO easy. Let’s open the source to see what we built.
<template>
<div class="hello">
...some markup...
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
The <template> tag wraps Vue template syntax enhanced markup.
The <script> tag wraps JavaScript.
The <style> tag wraps CSS.
Aside from placing the styling at the end of the file, this source file looks an awful lot like an html file that a browser could interpret. There is a lot going on under the hood, but Vue doesn’t clutter the source with tooling bloat.
Let’s concentrate on the <style> tag. The boilerplate contains some basic CSS, and an attribute named “scoped”. As the code comment implies, this attribute allows you to “scope” this block to only apply to this particular component, by automatically namespacing the CSS. Compare this to a more traditional approach, which might involve creating a selector like: “#hello-world-component-namespace.this-component {...}” in some faraway css file. The scoped attribute is optional. If you want to modify child components, one approach is to exclude the scoped attribute. You may also use multiple blocks of CSS, in case you wish to scope part of the code, but style children with a separate CSS block.
<style scoped>
h3 {
margin: 40px 0 0;
}
...
</style>
<style>
#child-component > h3 {
margin: 10px;
}
...
</style>
If you inspect the source code in your browser, you can see this style block rendered in the head of the document:
<style type="text/css">h3[data-v-469af010] {
margin: 40px 0 0;
}
ul[data-v-469af010] {
list-style-type: none;
padding: 0;
}
li[data-v-469af010] {
display: inline-block;
margin: 0 10px;
}
a[data-v-469af010] {
color: #42b983;
}
</style>
There is no need to version or deploy a CSS file, in this example. The data attribute in the first block is no accident. It uniquely identifies the component this styling is scoped to.
<div data-v-469af010="" class="hello">...</div>
Predictably, namespacing is suppressed for code blocks that are not scoped.
<style type="text/css">
#child-component > h3 {
margin: 10px;
}
</style>
An alternative to this approach is the ::v-deep combinator, which allows you to style children from a scoped block. Details can be found here.
But what about my Sass? Good news: SFCs tap into all of your favorite webpack preprocessors. Install sass-loader with npm:
<style scoped lang="scss">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
> li {
display: inline-block;
margin: 0 10px;
a {
color: #42b983;
&.very-green {
#00ff00;
}
}
}
}
</style>
But what about my Sass globals, includes, mixins, etc.? Never fear — the Sass block you include in your SFCs works just like your typical Sass source file. You can pass includes, set variables, nest media queries, and any other Sass convenience.
<style scoped lang="scss">
@import "mixins";
@import "global/global";
#main {
padding-top: em(54);
@media (min-width: $screen-md) {
padding-top: 0;
}
}
</style>
The vue-loader, which is included and pre-configured by Vue CLI, makes all of this work. Sass/Scss, Less, Babel, TypeScript, and other popular preprocessors and linters are supported. These features can be discretely configured, to the delight of advanced users.
The Vue.js SFC offers the convenience our source code deserves, without the file management and webpack tooling headaches. You can also use the component state to set class and style inside your templates, using built-in lifecycle hooks. It is also important to note that you can still include CSS the typical way, or in a mixed mode. This is especially handy when using rapid prototyping libraries like Bootstrap.
What’s the catch? Vue.js is a relatively new player. It’s picking up steam, but there aren’t as many applications using the framework as the competing products — Angular and React. That means the user community is comparably small. Examples are slim and basic. You are cutting your own trail. Also, we have detected some “spookiness” in the way preprocessors react to code structure. The preprocessors may need some configuration and babysitting, once you scale into a larger project.
_________________________________________
0 notes
Text
How to Make Your Web App More Reliable and Performant Using webpack: a Yahoo Mail Case Study
By Murali Krishna Bachhu, Anurag Damle, and Vishal Patel
As engineers on the Yahoo Mail team at Oath, we pride ourselves on the things that matter most to developers: faster development cycles, more reliability, and better performance. Users don’t necessarily see these elements, but they certainly feel the difference they make when significant improvements are made. Recently, we were able to upgrade all three of these areas at scale by adopting webpack® as Yahoo Mail’s underlying module bundler, and you can do the same for your web application.
What is webpack?
webpack is an open source module bundler for modern JavaScript applications. When webpack processes your application, it recursively builds a dependency graph that includes every module your application needs. Then it packages all of those modules into a small number of bundles, often only one, to be loaded by the browser.
webpack became our choice module bundler not only because it supports on-demand loading, multiple bundle generation, and has a relatively low runtime overhead, but also because it is better suited for web platforms and NodeJS apps and has great community support.
Comparison of webpack to other open source bundlers
How did we integrate webpack?
Like any developer does when integrating a new module bundler, we started integrating webpack into Yahoo Mail by looking at its basic config file. We explored available default webpack plugins as well as third-party webpack plugins and then picked the plugins most suitable for our application. If we didn’t find a plugin that suited a specific need, we wrote the webpack plugin ourselves (e.g., We wrote a plugin to execute Atomic CSS scripts in the latest Yahoo Mail experience in order to decrease our overall CSS payload**).
During the development process for Yahoo Mail, we needed a way to make sure webpack would continuously run in the background. To make this happen, we decided to use the task runner Grunt. Not only does Grunt keep the connection to webpack alive, but it also gives us the ability to pass different parameters to the webpack config file based on the given environment. Some examples of these parameters are source map options, enabling HMR, and uglification.
Before deployment to production, we wanted to optimize the javascript bundles for size to make the Yahoo Mail experience faster. webpack provides good default support for this with the UglifyJS plugin. Although the default options are conservative, they give us the ability to configure the options. Once we modified the options to our specifications, we saved approximately 10KB.
Code snippet showing the configuration options for the UglifyJS plugin
Faster development cycles for developers
While developing a new feature, engineers ideally want to see their code changes reflected on their web app instantaneously. This allows them to maintain their train of thought and eventually results in more productivity. Before we implemented webpack, it took us around 30 seconds to 1 minute for changes to reflect on our Yahoo Mail development environment. webpack helped us reduce the wait time to 5 seconds.
More reliability
Consumers love a reliable product, where all the features work seamlessly every time. Before we began using webpack, we were generating javascript bundles on demand or during run-time, which meant the product was more prone to exceptions or failures while fetching the javascript bundles. With webpack, we now generate all the bundles during build time, which means that all the bundles are available whenever consumers access Yahoo Mail. This results in significantly fewer exceptions and failures and a better experience overall.
Better Performance
We were able to attain a significant reduction of payload after adopting webpack.
Reduction of about 75 KB gzipped Javascript payload
50% reduction on server-side render time
10% improvement in Yahoo Mail’s launch performance metrics, as measured by render time above the fold (e.g., Time to load contents of an email).
Below are some charts that demonstrate the payload size of Yahoo Mail before and after implementing webpack.
Payload before using webpack (JavaScript Size = 741.41KB)
Payload after switching to webpack (JavaScript size = 669.08KB)
Conclusion
Shifting to webpack has resulted in significant improvements. We saw a common build process go from 30 seconds to 5 seconds, large JavaScript bundle size reductions, and a halving in server-side rendering time. In addition to these benefits, our engineers have found the community support for webpack to have been impressive as well. webpack has made the development of Yahoo Mail more efficient and enhanced the product for users. We believe you can use it to achieve similar results for your web application as well.
**Optimized CSS generation with Atomizer
Before we implemented webpack into the development of Yahoo Mail, we looked into how we could decrease our CSS payload. To achieve this, we developed an in-house solution for writing modular and scoped CSS in React. Our solution is similar to the Atomizer library, and our CSS is written in JavaScript like the example below:
Sample snippet of CSS written with Atomizer
Every React component creates its own styles.js file with required style definitions. React-Atomic-CSS converts these files into unique class definitions. Our total CSS payload after implementing our solution equaled all the unique style definitions in our code, or only 83KB (21KB gzipped).
During our migration to webpack, we created a custom plugin and loader to parse these files and extract the unique style definitions from all of our CSS files. Since this process is tied to bundling, only CSS files that are part of the dependency chain are included in the final CSS.
18 notes
·
View notes
Photo

A way to look up JavaScript operators
#514 — November 13, 2020
Unsubscribe | Read on the Web
JavaScript Weekly

10 Insights From Adopting TypeScript At Scale — A fantastic writeup (from a TC39 member, no less) of how Bloomberg (the financial media company) adopted TypeScript and now has 2,000 full-time JavaScript engineers. Curiously we also learn that Bloomberg also have their own JavaScript runtime built around the V8 engine.
Rob Palmer (TC39 and Bloomberg)
A Way to Look Up JavaScript Operators — Quick, name as many operators as you can! Got to about ten or so? This site covers about fifty with a quick explanation of each (well, except the bitwise ones).
Josh W Comeau
The Most Complete Spreadsheet Solution for JavaScript Apps — New Release: Fast enterprise JavaScript spreadsheet for delivering true spreadsheet experiences. Learn more about SpreadJS v14 including native Excel I/O, Calc Engine with 450+ functions and more. Download a free trial or view the online demos.
SpreadJS by GrapeCity, Inc. sponsor
Angular 11 Released — Are you one of the allegedly 1.7 million developers using Angular? Maybe experimental webpack 5 support, faster builds, improved hot module replacement support, and automatic inlining of fonts can tempt you onto the latest version.
Mark Techson (Google)
Babylon.js 4.2 Released: Powerful 3D Rendering Engine — Babylon.js is a particularly powerful 3D rendering engine aimed at artists, game developers, and anyone with 3D ideas to explore. New to 4.2 is a new particle editor, sprite editor, texture inspector, and more. See the playground if you want a quick play.
Babylon.js
'No More Free Work from Marak' — The creator of faker.js (a library for creating dummy data) pushing back against supporting businesses for free with his open source work has become a cause célèbre in the past week. “Pay me or fork this,” he says. Whatever your take, the topic of work vs reward in open source will remain both important and divisive.
Marak X
⚡️ Quick bytes:
We've not had time to go through them yet, but VueConf Toronto has released a lot of talk videos from their recent online conference.
Replay is a React-inspired JavaScript game engine and they're having a game jam starting today and running for a week.
Windows user? The Windows Terminal Preview 1.5 release may interest you.
The TypeScript team have written up some notes on TypeScript's release process.
📚 Tutorials, Opinions and Stories
Rethinking the JavaScript Pipeline Operator — Dan concludes “I hope that TC39 decides to reject this proposal” but it’s interesting to see how he reaches that conclusion.
Dan Shappir
Understanding Modules and import and export Statements — Modular programming demands, well, modules, and JavaScript now has built-in support for these and here’s the basics of their operation.
Tania Rascia
Is Your JavaScript Testing Stack Holding You Back? — Learn how to boost your productivity with the ultimate development workflow.
Wallaby.js sponsor
Things I Don’t Like About Vue.js (as a React Engineer) — Well, we love Vue, but to be fair to Harry, he did write What Vue.js Does Better Than React recently too ;-)
Harry Wolff
Back to Basics: Event Delegation — Events don’t just occur on the element you apply them to. Instead they go all the way down the DOM tree to the event and back up again. Christian demonstrates where this can help you out.
Christian Heilmann
How to Detect When a Sticky Element Gets Pinned — …thanks to the IntersectionObserver API.
David Walsh
Live Workshop: Getting Started with OpenTelemetry in Node.js
Lightstep sponsor
▶ How to Recreate Tic Tac Toe with HTML, CSS, and JavaScript James Q Quick
You're Probably Not Using Promise.All Enough Sam Jarman
How to Create a Commenting Engine with Next.js and Sanity Bryan Robinson
▶ My VS Code Setup: Must Have Configurations and Shortcuts James Q Quick
🛠 Code & Tools

Mermaid: Markdown-'ish' Syntax for Generating Flowcharts, Sequence Diagrams, and More — Being able to ‘draw’ diagrams in a structured, text-based and have them render into something presentable is pretty appealing.
Knut Sveidqvist
jsdiff: A JavaScript Text Diffing Implementation — Can compare strings for differences in various ways including creating patches for the changes. The library is quite mature but just reached version 5.0. There’s an online demo too.
Kevin Decker
core-js 3.7.0: A Modular Standard Library and Polyfills for JS — A popular collection of polyfills covering ECMAScript features up to ES2021 level. The project has had some interesting problems recently, but releases are now flowing again.
Denis Pushkarev
CodeFix - Automatically Clean Up Technical Debt
CodeFix sponsor
React Frontload 2.0: Simple Full-Stack Data Loading for React — Do full stack data loading and state management inline in React components by writing a data loader in your component (with a hook) and it ‘just works’ with SSR and in the browser.
David Nicholas Williams
Running Vue.js in a Web Worker? — A promising prototype of running Vue.js in a Web Worker so that work is offloaded to a background thread with updates being sent back to the main thread asynchronously.
Jerzy Głowacki
Dexie.js: A Minimalistic IndexedDB Wrapper — IndexedDB is a widely supported browser API for data storage and Dexie aims to make it simpler to use (and will offer an approach for server syncing too.)
David Fahlander
Microsoft Edge Tools for VS Code — Use the Microsoft Edge Tools from within VS Code to see your site’s runtime HTML structure, alter its layout, fix styling issues as well as see your site’s network requests.
Visual Studio Marketplace
ShareDB 1.5: Realtime Database Backend Based on Operational Transformation — For when you need real time synchronization of JSON documents (such as for behind a real time collaboration app).
ShareJS
💻 Jobs
Senior / Intermediate Full Stack Developers (Sydney or Brisbane) — A SaaS business with phenomenal growth. True flexible working. You’ll have 5+ years in JavaScript / TypeScript, as well as production experience with AWS/Serverless.
Compono
JavaScript Developer at X-Team (Remote) — Join the most energizing community for developers and work on projects for Riot Games, FOX, Sony, Coinbase, and more.
X-Team
Find Your Next Job Through Vettery — Create a profile on Vettery to connect with hiring managers at startups and Fortune 500 companies. It's free for job-seekers.
Vettery
👀 A Correction
The File System Access API: Simplifying Access to Local Files — Several issues ago we mistakenly referred to this API’s spec as an ‘open standard’ when it's just a spec. It's Chrome only (for now), not a W3C standard, though it remains an interesting idea. (Thanks to reader Šime Vidas for noting our mistake and noting that the path from the WICG to a W3C standard is a long one indeed!)
Pete LePage and Thomas Steiner
by via JavaScript Weekly https://ift.tt/2IzXSPs
0 notes
Text
Some important CSS and JS Libraries
1. Styled components
An idea born in an Australian whisky bar has developed into a project of 18 K stars, widely embraced within the culture. Styled components make it simpler to use CSS in React components, by identifying styled components with encapsulated styles as a mediator layer without CSS classes. Styled-components are generated by literal notation using the ES6 framework to describe components. As you would normally do using CSS, CSS properties can be applied to the component as required. Styled components can create specific class names when the JS is parsed, and inject the CSS into the DOM. You will learn more about Max Stoiber in this great chat.
2. Radium
Radium is described as "A toolchain for React component styling" at 6.5 K stars and developed by FormidableLabs. With React without CSS, it's a collection of tools to handle inline types. Radium provides a simple interface and abstractions to manage CSS features that can not easily accommodate Radium inline styles, enabling you to bundle styles together with your React elements, combining javascript, html, and styling. It also provides rendering based on props, allowing you to design your components according to the state of your game.
3. AphroditeAphrodite is a framework-agnostic CSS-in-JS library with server-side rendering support, browser prefixing and limited CSS generation support. Aphrodite transforms everything into classes, using the class attribute.This project operates with or without Respond at 4 K stars and offers features such as modeled injection into the Dom, styles of auto prefixes and more, all at a fairly small size of 20k and a handful of dependencies. Here's a handy rundown of Aphrodite vs. Radium. 4. Emotion
At 4.2 K stars Emotion is a strong and versatile CSS-in-JS library that enables you to style string or object-based apps. To prevent variance problems with CSS it has uniform structure. Based on the glam library and its philosophy the concept is to maintain runtime output by parsing styles with babel and PostCSS while writing CSS. The core runtime is 2.3 kb, and 4 kb with support from React. Emotion isn't just about Reacting.
5. Glamorous
Note: the project is no longer actively maintained! still cool though :)
At 3.6 K stars, PayPal's Glamorous is focused to create styled components and jsxtyle inspired "maintainable CSS with React." Kent C. Dodds describes the project as "React component styling with an elegant (inspired) API, small footprint (< 5 kb gzipped) and great performance (through glamour)." It has a rather similar API to modeled parts, and under the hood it uses similar methods.
6. Glamor
Glamor, inspired by ideas from this great talk, is small and powerful. It helps you to write CSS inline in your components using the same supports for style prop Object CSS syntax React. It is fast and efficient, independent system, serverside / static rendering and adds vendor prefixes / fallback values. Here's a short introductory API notes, a comparison of Glamor CSS techniques and a helpful Glamor tutorial with Gatsby.
7. Fela
<FelaComponent style={{ backgroundColor: 'blue', color: 'red' }} render={({ className, theme }) => ( <div className={className}>I am red on blue.</div> )} />
Fela is a project developed in JavaScript for State-Driven Styling, highlighting 3 things: rendering styling dynamic by design, introducing framework-agnostic (Bindings for Reacting) and performing. Based on the state of the application it is adjustable by nature and renders types. It generates atomic CSS and supports all common features of CSS such as media queries, pseudo-classes, keyframes and font faces. It can be used on any view list, including the native React.
8. Styletron
Thanks to this
code-carrot post
Styletron is a "component-oriented styling toolkit" at 2500 stars. Styletron supports stateless, single-element styled components as primitive base styling with conditional / dynamic styling prop interfaces, and style composition via (typed) JavaScript objects without additional tooling (e.g. Webpack loaders, Babel plugins, etc.). The design of style objects is often un-opinioned on. This fascinating HN thread lets you know more.
9. JSSJSS is a CSS abstraction that uses JavaScript to define styles in a declarative and maintenable manner. It is a high performance compiler JS to CSS that operates both runtime and server-side. This core library is agnostic at low level and frame, and is around 6 KB (minified and gzipped). This can also be expanded by API plugins. Here's a good SCSS (Sass) conversion tutorial here. Test out even React-JSS, a React JSS integration.
10.
Bootstrap Icons
For their icon library the Bootstrap team recently published the Alpha 3 Update. The newest update adds tons of new designs and now has over 500 icons on the Bootstrap SVG icon pack. Bootstrap Icons are designed to interact with components in Bootstrap, from shape controls to navigation. Bootstrap icons are SVGs, so they can easily and quickly scale and be styled with CSS. Although built for Bootstrap, they will work in any project. They are open source (MIT), so you can access, use, and expand it free of charge. Heads up though, right now they are in alpha and open to drastic changes.
11.
Polka
This is my short analysis of Polka which is "... just a native HTTP server with added routing, middleware, and sub-applications support ...!" even though express is relatively light, polka is lighter. What I find fascinating in this approach gives you even more insight into how to build an application. I think Polka is an excellent way to express yourself. With only a few extra modules, you'll have a fully fledged system with stable paths, templating, static files providing in a more lightweight (and hopefully faster) bundle all you have in express. It has not the same express acceptance but this could be an advantage.
12.
Size limit
Open-source tool to measure the performance of JS apps that offers an estimation of how much time end-users will need to run your Javascript. It can be plugged into Travis CI, Circle CI, GitHub Behavior so it runs automatically and prevents over-budget size limit commits.
13.
Stryker
Stryker is a very fascinating project in JavaScript and other languages to run mutation testing. It works by adding "mutations" to the code and running tests on them in random locations, testing how many of the mutations pass and how stable the code really is. By an example let's explain this, Suppose you're creating an online casino. Users are only permitted to access the casino if they are over 18. So you write the following piece of code to test if anyone can access the site:
function isUserOldEnough(user) { return user.age >= 18; }
Stryker will find the return statement and decide to change it in several ways:
/* 1 */ return user.age > 18; /* 2 */ return user.age < 18; /* 3 */ return false; /* 4 */ return true;
We call such shifts mutants. After discovering the mutants, they are introduced one by one and the experiments are performed against them. If at least one of the experiments fails, we're saying the mutant is murdered. This is what we want to see! If no check fails, then it has succeeded. The better the experiments survive the fewer mutants.Stryker produces the results in various formats. One of the easiest reporters to read is the plain text:
Mutant killed: /yourPath/yourFile.js: line 10:27 Mutator: BinaryOperator - return user.age >= 18; + return user.age > 18; Mutant survived: /yourPath/yourFile.js: line 10:27 Mutator: RemoveConditionals - return user.age >= 18; + return true;
The direct text reporter outputs precisely how the code has been changed and which mutator has been used. It would then tell us whether a mutant has been killed which means that at least one test has failed, or whether it has survived. In this case the second mutation is marked as survivor. This means that a test that specifically checks for age younger than 18 is possibly lacking
14.
Dinero.js
Dinero is a JavaScript library designed to work with monetary values. It has a well-designed API which contains all the methods for money and currency operations you might need. Dinero.js allows the development, estimation and formatting of monetary values in JavaScript. You can do arithmetic operations, read and format them thoroughly, search for a variety of items to make your own creation process simpler and safer.
15.
Uppload
Uppload.js is a modern JavaScript library designed to enhance the experience of uploading images. The library offers an elegant interface for file collection that allows the user to drag-drop images from the locale.It also allows you to import images from any data source, such as URL, camera, Instagram post, Facebook public post, etc. Thanks to its plugin program, it provides multiple upload options, allowing you to add more image sources, such as Instagram, screenshots, Giphy and more.You are also allowed to crop, resize, rotate the client-side images until they are submitted to server.
16.
MoreToggels
Pure CSS library offering over 50 stylish checkbox toggles of a pleasant variety. These are very easy to use and customize-only surround a div in your checkbox, add the right class and it's done.
17.
μPlot
Fast, memory-efficient diagram library to generate superb 2D Canvas-based charts. It offers lots of different types of graphs, lots of customization options and other cool features.
18.
Rsup Progress
Easy but still very successful progress bar plugin with promising support and smooth animations. It is super easy to configure and very useful to show the load times at the top of the page. 19.
Bootstrap Treeview
Bootstrap treeview is used to represent hierarchical information starting with the root element and continuing with its children and their respective items. Besides the root every element has a parent and can have children. Easy Bootstrap 4 plugin designed to build elegant treeviews with collapse list objects. It's a fantastic little feature and we wouldn't be shocked to see it integrated with future Bootstrap models. Siblings are objects with one parent and the same. Objects can collapse and expand.
20.
Electron React Boilerplate
Electron React Boilerplate uses Electron, React, Redux, React Router, Webpack and React Hot Loader for rapid application creation (HMR).Great starting kit for the production of Electron-based cross-platform mobile applications. The project GitHub provides a strong framework to help you customize everything and get started in no time.
21.
Panolens
They're panolens. Js is a WebGL focused and event-driven panoramic viewer. Lean and versatile. It is constructed over Three. Amazing JavaScript panorama viewer library right in the browser to create beautiful 360 ° experience. Three.js-based library keeps output fast and smooth, even when viewing high quality images or videos.
22.
Octomments
Very smart solution for adding comments to your website which uses GitHub as a discussion source. The project consists of a GitHub App and a JS library working together to view a fully featured comment section, hosted within a selected repo issue of GitHub.
23.
Rome
Rome is a toolchain experimental to JavaScript. It includes a parser, linter, formatter, bundler, frame checking and more. It aims to be a detailed platform for everything that relates to JavaScript source code production. Rome is not a set of known instruments. All the tools are designed specifically for Rome, do not rely on any external dependencies and are made to communicate with each other seamlessly.
24.
massCode
MassCode is a snippet manager for developers of open-source code. This nice little app offers a clean interface for all of your code snippets and cheatsheets to handle. Runs on Mac, Linux and Windows.
25.
Bootlint
The Bootstrap team's new linter tool that lets you test if your pages use Bootstrap's components with properly organized HTML. It also ensures the appropriate tags are used, an HTML5 doctype declaration is included, and the page's overall markup is accurate.
26.
DarkModeJS
This library uses the mix-blend-mode css to get Dark Mode on all of your websites. Only copy and paste the snippet and you'll get a plugin to turn the Dark Mode on and off. You can also use it programmatically, without the button. Lightweight module, installed in Vanilla. Super lightweight JS library to help you integrate dark & light teams into your applications. It senses local time for the user and changes the UI appearance accordingly. It doesn't have light and dark themes.
27.
Hex Engine
Modern 2D engine designed to render browser games. This versatile toolkit for game development features a Canvas-based rendering engine, aids in physics and sound, gamepad support, integrated design tools, and more.
28.
Chardin.js
A tiny JS tool which makes adding overlay instructions for your apps super simple. These guides can be extremely helpful to clarify the UI, demote the various features of the app or simply show the user what to do next.
29.
Sharect
Share. Js is a lightweight, zero-dependent JS library that transforms any text selected into quotes that can be posted on Twitter and/or Facebook, as you can see in Medium.com.
30.
Lottie
Lottie is an Android, iOS, Web, and Windows library that parses Adobe After Effects animations exported as json with Bodymovin and makes them natively accessible on the smartphone and on the web! The Airbnb developer team's incredible library that exports Adobe After. This makes animations that can be very complex with lots of details and keyframes as well as being super-performing and smooth buttery. It's now designed to expand its use to android, iOS, React Native and Windows in addition to his great work.
31.
Vue Interactive Paycard
View-Interactive-Paycard-Smooth and sweet micro-interaction credit card shape. Includes the printing of numbers, validation and automatic identification of type of token. Designed with viewjs, and completely sensitive as well. Very impressive credit card snippet type which beautifully animates as users input their data. One of the finest projects we've seen all year round, with everything polished to perfection, from the typography to the animations. It's not only pretty either-the card is also very user friendly with the formatting of numbers, validation and the identification of card size. Also, when entering cc info, users actually prefer a well-known interface and not some custom UI.
32.
Cube.js
Cube.js is a scalable open source platform for building analytical web applications and designing your own sophisticated, custom analytics systems. It consists of a wide SDK frontend and a lightweight API backend which can be linked to most databases and systems like MySQL, Postreges and MongoDB .. It is primarily used for developing internal business intelligence tools or for applying customer-facing analytics to an existing app.
33.
Tessaract
Tesseract. Js is the pure Javascript port of Tesseract's popular OCR engine. Node and browser JavaScript library which extracts text from images. It analyzes the image, automatically detects location and orientation of the text, and with great precision extracts words and sentences. Tessaract can recognize more than 60 languages including more complex ones such as Chinese, Arabic and Russian
34.
Barba
Lightweight library for linking seamless transitions to pages on your website. It takes up your usual static website and makes it a great-looking single-page application experience. It helps to reduce the delay between loading pages, to decrease requests for HTTP, and to make the web feel more premium.
35.
Freezeframe
This fun JavaScript library allows for the control of animated GIF playback. It can start and pause the GIFs, for example, based on user feedback such as clicks or hover. As it uses a canvas feature to draw the individual frames, it is also very performant under the hood.
36.
Ink
React-based App building command line interface. It provides a great range of predefined components which can be used to accelerate the creation of terminal interfaces while also allowing features such as more sophisticated templates and controls to be added.
37.
Instant Page
This fun library speeds up loading times when users hover over them by prefretching the links. This makes loading of a page faster until the user clicks on a connection and navigates to the next page. With the latest update it can also automatically prefix all links in a list-great for static content.
38.
Filepond
FilePond is a JavaScript library that lets you upload silky smooth drag n 'drop files. It has a polished UI which is a pleasure to use, while also offering some interesting features under the hood such as optimizing photos for quicker uploads. Just 21 kB gzipped, with adapters available with React, Vue, and jQuery for easier implementation. These docs can assist in downloading, setting up, updating and extending FilePond. If you don't know FilePond you can find more detail on the FilePond product page.
39.
Micromodal
Micromodalistic. Js is a modal library written in pure JavaScript, lightweight, configurable and 11y-enabled. It helps you to build modal dialogs consistent with WAI-ARIA guidelines, with trust and with minimal configuration. Minified and gzipped at just 1.9 kb, it's a tiny library for big change.
40.
Brain.js
A great project for all of you who want to take their first steps in machine learning, Brain.js offers a powerful framework for working in a JavaScript environment with the neural networks. It has lots of examples of excellent documentation that will help you understand some of the most important ML techniques.
As a reputed Software Solutions Developer we have expertise in providing dedicated remote and outsourced technical resources for software services at very nominal cost. Besides experts in full stacks We also build web solutions, mobile apps and work on system integration, performance enhancement, cloud migrations and big data analytics. Don’t hesitate to
get in touch with us!
#b2b seo
#b2bservices
#b2b ecommerce
#b2bsales
0 notes